package com.example.base.system.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.example.base.excetion.GlobalExcetion;
import com.example.base.system.domain.SysJob;
import com.example.base.system.domain.vo.SysJobVo;

import java.io.Serializable;
import java.util.List;

/**
 * <p>
 * 定时任务表 服务类
 * </p>
 *
 * @author xiong
 * @since 2024-02-07
 */
public interface SysJobService extends IService<SysJob> {

    public SysJob saveOrUpdateSysJob(SysJobVo vo) throws GlobalExcetion;

    public SysJob updateSysJobById(SysJob sysjob) throws GlobalExcetion;

    /**
     * 获取任务通过分组名
     * @param name
     * @return
     * @throws GlobalExcetion
     */
    public SysJob getSysJobByGroupName(String name) throws GlobalExcetion;

    /**
     * 执行一次
     * @param id
     * @return
     * @throws GlobalExcetion
     */
    public SysJob execOne(Serializable id) throws GlobalExcetion;

    /**
     * 获取系统任务通过应用名称
     * @param appName 应用名称
     * @return
     */
    public List<SysJob> getSysJobAppName(String appName);

}
